import {ref} from "vue"
import type {Ref} from "vue"


const nowtime:Ref = ref(0)
let a:any = null
function usetime() {
    a && clearTimeout(a)
    const xunhuan = ()=>{
        nowtime.value = new Date()
        a = setTimeout(()=>{
            xunhuan()
        },1000)
    }
    xunhuan()
    return nowtime
}

export default usetime